<template>
  <div class="page ta-c">
    <div style="width: 260px; margin: 20px auto;">
      <image src="https://ark-1256750454.cos.ap-shanghai.myqcloud.com/app-statics/create-success.png" mode="widthFix"></image>
    </div>
    <div class="c-blue fw fs-xl pdv-l">保存成功！</div>
    <div class="fs-xl pdv-xl bdb-h" style="margin-bottom: 50px;"><span class="c-gray">已保存到首页列表中，</span><a class="ui btn-link" @tap="goDocuments">去查看</a></div>
    <div>
      <div class="c-gray">会根据微信群自动生成班级哦</div>
      <div class="pdh-xxl pdv-l">
        <button class="ui btn primary" open-type="share">通知到微信群</button>
      </div>
    </div>
    <page-common></page-common>
  </div>
</template>

<script>
import PageCommon from '@/components/page-common'
import base from '@/mixins/base'
import { mapGetters, mapActions } from 'vuex'
import dayjs from 'dayjs'

export default {
  mixins: [base],
  components: {
    PageCommon,
  },
  computed: {
    ...mapGetters([
      'role',
      'loginer'
    ]),
    ...mapGetters('document', [
      'document',
    ])
  },
  onShareAppMessage() {
    return {
      title: this.document.name,
      path: '/pages/task-invite/main?documentId=' + this.document.id + '&distributeAt=' + dayjs().toISOString() + '&groupOwnerId=' + this.loginer.id,
      imageUrl: ''
    }
  },
  methods: {
    goDocuments () {
      wx.redirectTo({
        url: '/pages/documents/main'
      })
    }
  }
}
</script>

<style scoped lang="less">
@import "../../assets/less/var.less";

.page {
  background-color: white;
  height: 100%;
}
</style>
